package az.mecid.rssreader.client.ui.widget;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.ui.*;

/**
 * Created by IntelliJ IDEA.
 * User: mega
 * Date: 25.02.2010
 * Time: 1:57:13
 */
public class FeedAddWidget extends Composite implements ClickHandler{

    private PushButton button = new PushButton(new Image("images/add.png"));

    private PopupPanel popupPanel = new PopupPanel(true);

    private TextBox feed = new TextBox();

    private Button addFeedButton = new Button("Add");

    public FeedAddWidget() {

        button.addClickHandler(this);

        FlowPanel flowPanel = new FlowPanel();
        flowPanel.add(feed);
        flowPanel.add(addFeedButton);

        popupPanel.setWidget(flowPanel);

        initWidget(button);
    }

    public TextBox getFeed() {
        return feed;
    }

    public Button getAddFeedButton() {
        return addFeedButton;
    }

    public void onClick(ClickEvent clickEvent) {
        popupPanel.show();
    }
}
